package com.example.mapper;

import com.example.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface UsersMapper {
    int insertUser(User user);
    
    int updatePasswordByPhone(User user);
    
    User findByPhone(String phone);
    
    User findByUsername(String username);
    
    int updateUsernameInUsers(@Param("phone") String phone, @Param("newUsername") String newUsername);
    
    int updateUsernameInGroups(@Param("oldUsername") String oldUsername, @Param("newUsername") String newUsername);
    
    // 添加项目表更新方法
    int updateUsernameInProjects(@Param("oldUsername") String oldUsername, @Param("newUsername") String newUsername);
    
    // 添加用户搜索方法
    List<User> searchUsers(@Param("username") String username, @Param("phone") String phone);
}